<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <script src="../00.插件/babel.min.js"></script>
  <script src="../00.插件/react.development.js"></script>
  <script src="../00.插件/react-dom.development.js"></script>
</head>
<body>
<!--<button>点击修改内容</button>-->
<div id="app"></div>

<script type="text/babel">

  function Title() {
    return (
      <h1>开始测试state属性</h1>
    )
  }

  class Content extends React.Component{
    //存在再组件实例中的属性
    state = {
      content:"今天皮肤全场半价",
      count:99,
      self:true
    }
    render(){
      const {content,count,self} = this.state
      console.log("-----render-----",this)
      return (
        <div>
          <Title/>
          <hr/>
          <h2>{content}</h2>
          <p style={{color:'red',fontSize:'24px'}}>史诗皮肤：原价{count}</p>
          <p>目前活动已经:{self?'开始！！！':'结束了~~'}</p>
        </div>
      )
    }
  }

  const root = ReactDOM.createRoot(document.getElementById("app")).render(<Content/>)
</script>
</body>
</html>